home *** CD-ROM | disk | FTP | other *** search
- @echo off
- @if not "%8" == "" echo %8
- rem [
- rem Name: u.swupdate.bat
- rem
- rem Derived from: (original)
- rem
- rem Author: David Lillie
- rem
- rem Created on: Sep 1996
- rem
- rem Sccs ID: @(#)u.swupdate.bat 1.52 02/01/98
- rem
- rem Coding Stds:
- rem
- rem Purpose: To upgrade a SoftWindows hard disk container file.
- rem This is called automatically.
- rem
- rem Parameters: 1 host OS type i.e. "mac" or "unix"
- rem 2 new serial number (8 hex digits)
- rem 3 old serial number (8 hex digits)
- rem 4 Host System name
- rem 5 Host System release
- rem 6 Host System version
- rem 7 Host System hardware type
- rem 8 On/Off argument for echo
- rem 9 Drive letter for "WIN95" setup directory.
- rem
- rem Copyright 1997 Insignia Solutions PLC. All rights reserved.
- rem ]
-
-
- rem Set path to upgrade utils (for an automatic upgrade)
- if exist d:\insignia\ibatch.exe path d:\;d:\insignia;%path%
-
- rem Check to see if we have a valid first parameter
- if "%1"=="" goto manstamp
- rem Set up host OS environment variable
- ibatch swupdate_host tolower %1
- if "%swupdate_host%"=="unix" goto CheckSerial
- if "%swupdate_host%"=="mac" goto CheckSerial
- goto manstamp
-
- :CheckSerial
- rem Check that we have the right number of parameters
- if "%9"=="" goto manstamp
-
-
- rem Determine whether this is a newly-installed Intel OS
- set OSIsNew=0
- ibatch swupdate_NewOS = 0x%2 & 0xF000 #lx
- ibatch swupdate_OldOS = 0x%3 & 0xF000 #lx
- itest 0x%3 ">=" 0xF0000000
- if errorlevel 1 itest "%swupdate_OldOS%" "!=" "%swupdate_NewOS%"
- if errorlevel 1 set OSIsNew=1
-
-
- rem Make copy of serial number which we might modify
- set new_sn=%2
-
- rem Get language code from serial number.
- ibatch langNO string "%new_sn%" 2 2
- ibatch langNO tolower "%langNO%"
-
- rem Determine which language extension to use
- call dec_lang langID %langNO%
- if not "%langID%" == "" goto GotLang
-
- rem Unknown language in requested serial number.
- rem Try to detect the language from the hard disk.
- call findlang langNO
-
- rem Insert the language code into the serial number
- ibatch sn_head string "%new_sn%" 0 2
- ibatch sn_tail string "%new_sn%" 4 4
- set new_sn=%sn_head%%langNO%%sn_tail%
- set sn_head=
- set sn_tail=
-
- call dec_lang langID %langNO%
- if not "%langID%" == "" goto GotLang
-
- echo Unrecognised language on drive C:
- pause
- goto reboot
-
- :GotLang
-
- rem Ensure we have 'our' directory.
- if not exist c:\insignia\nul md c:\insignia
-
- rem If there is no upgrade history, extract what we can from
- rem the last upgrade log (if there was one).
- rem We are interested in the two top batch files and the serial numbers of
- rem the disks (searching for "-" finds the serial nos independent of language).
- if exist c:\insignia\uphist.log goto nonewhist
- if not exist c:\insignia\up.log goto nonewhist
- find /i /n "swupdate" c:\insignia\up.log >> c:\insignia\uphist.log
- find /i /n "w95once" c:\insignia\up.log >> c:\insignia\uphist.log
- find /i /n "-" c:\insignia\up.log >> c:\insignia\uphist.log
- :nonewhist
-
- rem Create log file afresh for each upgrade. Append to the history file.
- echo %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 > c:\insignia\up.log
- echo. | date >>c:\insignia\up.log
- echo. | time >>c:\insignia\up.log
- vol c: >>c:\insignia\up.log
- vol d: >>c:\insignia\up.log
- echo %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 >>c:\insignia\uphist.log
- echo. | date >>c:\insignia\uphist.log
- echo. | time >>c:\insignia\uphist.log
- vol c: >>c:\insignia\uphist.log
- vol d: >>c:\insignia\uphist.log
-
- rem Get interesting part of old serial number in lower case.
- ibatch old_swinv string %3 0 2
- ibatch old_swinv tolower %old_swinv%
-
-
- if not "%swupdate_host%" == "unix" goto no_esave
-
- rem Load FSA drivers and save user's E: drive setup. We need to restore
- rem it because "net use" changes the user's configuration.
- rem We need to frig the DOS version for devlod on Windows 95 disks.
-
- dosver 6 0 d:\insignia\devlod.com d:\insignia\host.sys >>c:\insignia\up.log
- fsadrive >>c:\insignia\up.log
- net use e: | ibatch swupdate_edir string 0 0
-
- rem Obtain selected keyboard defaults file if any.
- rem We do this here because we need to re-use FSA drive E: later.
- rem (Having bypassed config.sys, the effective LASTDRIVE is E:)
-
- net use e: /d>>c:\insignia\up.log
- net use e: $SWINHOME/local>>c:\insignia\up.log
- copy d:\unixonly\keybdef.unx c:\insignia\keyboard.def >>c:\insignia\up.log
- if exist e:\selected\keyboard.def copy e:\selected\keyboard.def c:\insignia >>c:\insignia\up.log
- net use e: /d>>c:\insignia\up.log
-
- :no_esave
-
- rem Ensure that critical files are writable (we make some read-only)
- if exist c:\insignia\*.* attrib -r c:\insignia\*.* /s
- if exist c:\windows\pif\suspend.pif attrib -r c:\windows\pif\suspend.pif
-
- rem Copy this file to drive C for manual updates.
- copy d:\swupdate.bat c:\insignia >>c:\insignia\up.log
-
- if not exist c:\windows\system.ini goto dosonly
- rem Test for Windows 95
- if exist c:\windows\ios.ini goto rawwin95
- rem Test for Windows For Workgroups
- if exist c:\windows\clipsrv.exe goto rawwfw
- rem Test for Windows 3.11 (NB emm386.exe exists on G:\ and C:\windows in
- rem a split setup).
- if exist c:\windows\emm386.exe goto rawwin311
-
- :dosonly
- set swupdate_os=dos
- set space_needed=5000
- checkspc %space_needed%
- if not errorlevel 1 goto no_space
-
- echo Adding Insignia drivers to DOS on drive C: ...
-
- rem Remove obsolete stuff
- call delfiles list c:\windows c:\windows\system %swupdate_os% %1 %OSIsNew%
-
- rem Copy files.
- xcopy /y d:\insignia c:\insignia >>c:\insignia\up.log
- xcopy /y d:\%1only c:\insignia >>c:\insignia\up.log
- if not exist c:\nwclient\nul md c:\nwclient >>c:\insignia\up.log
- xcopy /s /y d:\nwclient c:\nwclient >>c:\insignia\up.log
- c:
- cd \insignia
-
- rem Only overwrite config.sys and autoexec.bat if it is a clean (CD2) hard disk
- if not "%old_swinv%" == "f0" goto no_dosbatch
-
- set dos_type=msdos
- if not exist c:\dos\find.exe goto no_find
- ver | find "PC DOS" >nul
- if not errorlevel 1 set dos_type=pcdos
- :no_find
-
- call dosbatch %1 %langID% %dos_type%
- :no_dosbatch
-
- rem call d:\%1.bat dos c:\windows\system %langID% %4 %5 %6 %7
- goto purestamp
-
- :rawnowin
- echo No version of Windows installed on C:
- pause
- goto reboot
-
- :rawwfw
- set swupdate_os=wfw311
- set swupdate_os_name=Windows for Workgroups 3.11
- goto win31_and_wfw
-
- :rawwin311
- set swupdate_os=win311
- set swupdate_os_name=Windows 3.11
- :win31_and_wfw
-
- if not "%swupdate_host%" == "unix" goto win31hdf
-
- rem Detect split setup (the default for Unix Swin 2.0)
- rem If user.exe is present in G:\ and absent from C:\windows\system then
- rem this is a split setup. If it exists in both places then it means that
- rem either win2c.bat has been run, or it was put there ad hoc; either way
- rem it implies a hard disk only setup.
- rem Because we have bypassed config.sys and autoexec.bat, we need to set up
- rem FSA and find the fsa windows directory explicitly. Furthermore we are
- rem constrained to drive E: because we cannot execute a LASTDRIVE command.
-
- if exist c:\windows\system\user.exe goto win31hdf
- net use e: /d>>c:\insignia\up.log
- net use e: $SWINHOME/windows>>c:\insignia\up.log
-
- if exist e:\user.exe goto win31fsa
- net use e: /d>>c:\insignia\up.log
- goto rawnowin
-
- :win31hdf
- set space_needed=5000
- checkspc %space_needed%
- if not errorlevel 1 goto no_space
- echo Adding Insignia drivers to %swupdate_os_name% on drive C: ...
- set swupdate_windir=c:\windows
- set swupdate_sysdir=c:\windows\system
- goto win31both
-
- :win31fsa
- set space_needed=4000
- checkspc %space_needed%
- if not errorlevel 1 goto no_space
- echo Adding Insignia drivers to %swupdate_os_name% on FSA drive $SWINHOME/windows ...
- set swupdate_windir=e:
- set swupdate_sysdir=e:
-
- :win31both
-
- rem Remove obsolete stuff
- call delfiles list %swupdate_windir% %swupdate_sysdir% %swupdate_os% %1 %OSIsNew%
-
- rem Copy files.
- xcopy /y d:\insignia c:\insignia >>c:\insignia\up.log
- xcopy /y d:\%1only c:\insignia >>c:\insignia\up.log
-
- call copywinf d:\insignia\for_win %swupdate_windir% >>c:\insignia\up.log
- call copywinf d:\%1only\for_win %swupdate_windir% >>c:\insignia\up.log
- call copywinf d:\insignia\for_w31 %swupdate_windir% >>c:\insignia\up.log
- call copywinf d:\%1only\for_w31 %swupdate_windir% >>c:\insignia\up.log
- xcopy /y d:\insignia\for_win\system %swupdate_sysdir% >>c:\insignia\up.log
- xcopy /y d:\%1only\for_win\system %swupdate_sysdir% >>c:\insignia\up.log
- xcopy /y d:\insignia\for_w31\system %swupdate_sysdir% >>c:\insignia\up.log
- xcopy /y d:\%1only\for_w31\system %swupdate_sysdir% >>c:\insignia\up.log
- if not exist c:\nwclient\nul md c:\nwclient >>c:\insignia\up.log
- xcopy /s /y d:\nwclient c:\nwclient >>c:\insignia\up.log
- if exist d:\%langID%only\for_win\nul call copywinf d:\%langID%only\for_win %swupdate_windir% >>c:\insignia\up.log
- c:
- cd \insignia
-
- rem Only overwrite config.sys and autoexec.bat if it is a clean (CD2) hard disk
- if "%old_swinv%" == "f0" call dosbatch %1 %langID% win31
-
- call w31batch %swupdate_windir% %swupdate_sysdir% %swupdate_os% %1 %langID% %3
- call d:\%1.bat win31 %swupdate_sysdir% %langID% %4 %5 %6 %7
- if "%swupdate_host%" == "unix" net use e: /d>>c:\insignia\up.log
- goto purestamp
-
- :rawwin95
- ver | find "4." | ibatch swupdate_os_name string 0 10
- ibatch swupdate_os string "%swupdate_os_name%" 8 2
- set swupdate_os=win%swupdate_os%
-
- set space_needed=10000
- checkspc %space_needed%
- if not errorlevel 1 goto no_space
-
- echo Adding Insignia drivers to %swupdate_os_name% ...
-
- rem Remove obsolete stuff
- call delfiles list c:\windows c:\windows\system %swupdate_os% %1 %OSIsNew%
-
- rem Copy files.
- xcopy /y d:\insignia c:\insignia >>c:\insignia\up.log
- xcopy /y d:\%1only c:\insignia >>c:\insignia\up.log
- xcopy /s /y d:\insignia\for_win c:\windows >>c:\insignia\up.log
- xcopy /s /y d:\%1only\for_win c:\windows >>c:\insignia\up.log
- xcopy /s /y d:\insignia\for_w95 c:\windows >>c:\insignia\up.log
- xcopy /s /y d:\%1only\for_w95 c:\windows >>c:\insignia\up.log
- if not exist c:\nwclient\nul md c:\nwclient >>c:\insignia\up.log
- xcopy /s /y d:\nwclient c:\nwclient >>c:\insignia\up.log
- if exist d:\%langID%only\for_win\nul xcopy /s /y d:\%langID%only\for_win c:\windows >>c:\insignia\up.log
- c:
- cd \insignia
-
- rem Only overwrite config.sys and autoexec.bat if it is a clean (CD2) hard disk
- if "%old_swinv%" == "f0" call dosbatch %1 %langID% win95
-
- call w95batch %swupdate_host% %new_sn% %3 %4 %5 %6 %7 %swupdate_os%
-
- rem Construct reg file to add the runonce entry and
- rem repair the installation source path (BCN 5506).
- echo REGEDIT4>c:\insignia\runonce.reg
-
- echo.>>c:\insignia\runonce.reg
- echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]>>c:\insignia\runonce.reg
- echo "IS_Customize"="c:\\insignia\\w95once.bat %swupdate_host% %new_sn% %3 %4 %5 %6 %7 %8 %langID%">>c:\insignia\runonce.reg
-
- set W95SourcePath=%9:\\%swupdate_os%
- ibatch W95SourcePath toupper "%W95SourcePath%"
- if not "%swupdate_host%" == "unix" goto no_unix95
- rem On Unix SoftWindows95, setup files are optionally installed on
- rem $SWINHOME/win95 (or $SWINHOME/win98) which is mounted on G:
- net use e: /d>>c:\insignia\up.log
- net use e: $SWINHOME>>c:\insignia\up.log
- if exist e:\%swupdate_os%\mini.cab set W95SourcePath=G:\\
- net use e: /d>>c:\insignia\up.log
- :no_unix95
- rem The setup files may still be on disk, in which case we should use them.
- if exist c:\windows\options\cabs\mini.cab set W95SourcePath=C:\\WINDOWS\\OPTIONS\\CABS
-
- echo.>>c:\insignia\runonce.reg
- echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]>>c:\insignia\runonce.reg
- echo "SourcePath"="%W95SourcePath%">>c:\insignia\runonce.reg
- set W95SourcePath=
-
- regedit c:\insignia\runonce.reg >>c:\insignia\up.log
- echo.>>c:\insignia\up.log
-
- rem Set up likely paths for Windows 95 setup files.
- mruedit d:\insignia\mrumod.spt >>c:\insignia\up.log
-
- rem Early versions of SoftWindows95 1.0 reported the wrong PnP ID for the
- rem Insignia ESDI controller. We patch the correct ID into the registry here,
- rem to prevent Windows displaying a reboot prompt during the upgrade.
- set enum_key=HKEY_LOCAL_MACHINE\Enum
- set eb_esdi_key=[%enum_key%\BIOS\*ISL060A]
- regedit /e c:\insignia\temp.reg %enum_key% >>c:\insignia\up.log
- type c:\insignia\temp.reg | find "%eb_esdi_key%" | ibatch found_key string 0 0
- if not "%found_key%" == "%eb_esdi_key%" regedit d:\ins_esdi.reg >>c:\insignia\up.log
- echo.>>c:\insignia\up.log
- del c:\insignia\temp.reg >>c:\insignia\up.log
-
- call d:\%1.bat win95 c:\windows\system %langID% %4 %5 %6 %7
- goto purestamp
-
- :purestamp
- echo Update complete.
- rem
- rem Restore user's FSA drive
- if not "%swupdate_edir%" == "" net use %swupdate_edir%>>c:\insignia\up.log
- rem
- rem Update disk version number
- rem
- debug <d:\upcode.inp d:\empty %new_sn% >nul
- goto reboot
-
- :manstamp
- rem swupdate has been activated manually
- rem Log the manual upgrade to the history file.
- echo Manual upgrade activated. OS=%1, Extra Parameters %2 %3 %4 %5 %6 %7 %8 %9 >>c:\insignia\uphist.log
-
- rem
- rem Set the first two digits of serial number to F1 and reboot.
- rem This will force an upgrade with the correct parameters
- debug <c:\insignia\upman.inp >nul
- goto reboot
-
- :reboot
- rem
- rem Restore user's FSA drive
- if not "%swupdate_edir%" == "" net use %swupdate_edir%>>c:\insignia\up.log
- rem
- rem Reboot
- rem
- debug <c:\insignia\reboot.inp >nul
- rem We should not get here, but if we do..
- goto End
-
- :no_space
- cls
- set sn=%space_needed%
- echo **************************************************************************
- echo * *
- echo * WARNING *
- echo * *
- echo * There is not enough free space on your C: drive to perform the *
- echo * upgrade. You need a minimum of %sn%000 bytes free. *
- echo * *
- echo * To increase the available free space, either: *
- echo * delete any unwanted files and restart; or increase the size *
- echo * of your C: drive as described in the product documentation. *
- echo * *
- echo **************************************************************************
- goto End
-
- :End
- rem
- rem Restore user's FSA drive
- if not "%swupdate_edir%" == "" net use %swupdate_edir%>>c:\insignia\up.log
-